<html>
<head>
<title>Fb.java</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.s0 { color: #629755; font-style: italic;}
.s1 { color: #629755; font-weight: bold; font-style: italic;}
.s2 { color: #a9b7c6;}
.s3 { color: #cc7832;}
.s4 { color: #6897bb;}
.s5 { color: #6a8759;}
.s6 { color: #808080;}
</style>
</head>
<body bgcolor="#2b2b2b">
<table CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#606060" >
<tr><td><center>
<font face="Arial, Helvetica" color="#000000">
Fb.java</font>
</center></td></tr></table>
<pre><span class="s0">/**</span>
 <span class="s0">* </span><span class="s1">@author </span><span class="s0">Zy</span>
 <span class="s0">*/</span>
<span class="s3">public class </span><span class="s2">Fb {</span>

    <span class="s3">protected static int </span><span class="s2">f(</span><span class="s3">int </span><span class="s2">n){</span>
        <span class="s3">if</span><span class="s2">(n&lt;=</span><span class="s4">1</span><span class="s2">) {</span>
            <span class="s3">return </span><span class="s4">1</span><span class="s3">;</span>
        <span class="s2">}</span>
        <span class="s3">return </span><span class="s2">f(n-</span><span class="s4">1</span><span class="s2">)+f(n-</span><span class="s4">2</span><span class="s2">)</span><span class="s3">;</span>
    <span class="s2">}</span>
    
    <span class="s3">public static void </span><span class="s2">main(String[] args) {</span>
        <span class="s3">int </span><span class="s2">j = </span><span class="s4">100</span><span class="s3">;</span>
        <span class="s3">for </span><span class="s2">(</span><span class="s3">int </span><span class="s2">i = </span><span class="s4">0</span><span class="s3">; </span><span class="s2">i &lt; j</span><span class="s3">; </span><span class="s2">i++) {</span>
            <span class="s2">System.out.println(</span><span class="s5">&quot;递归结果为：&quot;</span><span class="s2">+f(i))</span><span class="s3">;</span>
            <span class="s6">//Scanner scanner = new Scanner(System.in);</span>
        <span class="s2">}</span>
    <span class="s2">}</span>

<span class="s2">}</span>


</pre>
</body>
</html>